package com.yuyou.train.admin.api;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import com.yuyou.train.admin.service.IAuthUserService;
import com.yuyou.train.service.api.admin.dto.AuthUserDTO;
import com.yuyou.train.service.api.admin.entity.AuthUser;
import com.yuyou.train.service.api.admin.service.AuthUserAPI;

@RestController
public class AuthUserAPIImpl implements AuthUserAPI{

	@Autowired
	private IAuthUserService authUserService;

	@Override
	public AuthUserDTO findUseById(String id) {
		return authUserService.findAuthUser(id);
	}

	@Override
	public List<String> findUseAreaIdListById(String id) {
		List<String> list=new ArrayList<String>();
		AuthUser authUser=authUserService.selectBaseByPrimaryKey(id);
		if(!StringUtils.isEmpty(authUser.getAreaId())){
			String [] areaIds=authUser.getAreaId().split(",");
			list = Arrays.asList(areaIds);
		}
		return list;
	}




	




}
